package com.hibase.core.rule.utils;

import com.hibase.core.redis.util.RedisUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.concurrent.TimeUnit;

/**
 * @Description: TODO
 * @Author: liuyunlei
 * @Date: 2020/7/14 15:38
 * @Version: 1.0
 */
@Component
public class RedisUtils {

    @Autowired
    private RedisUtil redisUtil;

    public Object get(Object k) {
        return redisUtil.get("hibase-rule:" + k);
    }

    public void set(Object k, Object v) {
        redisUtil.setEx("hibase-rule:" + k,v, 60 * 24, TimeUnit.SECONDS);
    }


}
